
using UnityEngine;

public class Enemy_Skeleton : Enemy, ICounterable
{
    public bool CanStunned { get => canStunned; }
    public Enemy_DeadState skeletonDeadState;
    protected override void Awake()
    {
        base.Awake();
        idleState = new(this, stateMachine, "Idle");
        moveState = new(this, stateMachine, "Move");
        attackState = new(this, stateMachine, "Attack");
        battleState = new(this, stateMachine, "Battle");
        skeletonDeadState = new(this, stateMachine, "Dead");
        stunnedState = new(this, stateMachine, "Stunned");
    }
    protected override void OnDisable()
    {
        base.OnDisable();
        stateMachine.ChangeState(idleState);
    }
    protected override void OnEnable()
    {
        base.OnEnable();
        stateMachine.InitMachine(idleState);
    }
    public override void EntityDead()
    {
        base.EntityDead();
        stateMachine.ChangeState(skeletonDeadState);
        StopSlowdownEntityCo();
    }
    //处理敌人眩晕
    public void HanderCounter()
    {
        if (CanStunned)
            stateMachine.ChangeState(stunnedState);
    }
}
